By many-body quantum-chemical calculations, we investigate the role of two structural effects - local ligand distortions and the anisotropic Cd-ion coordination - on the magnetic state of Cd2Os2O7, a spin S=3/2 pyrochlore. We find that these effects strongly compete, rendering the magnetic interactions and ordering crucially depend on these geometrical features. Without trigonal distortions a large easy-plane magnetic anisotropy develops. Their presence, however, reverses the sign of the zero-field splitting and causes a large easy-axis anisotropy (D = -6.8 meV), which in conjunction with the antiferromagnetic exchange interaction (J = 6.4 meV) stabilizes an all-in/all-out magnetic order. The competition uncovered here is a generic feature of pyrochlore magnets.